<template>
	<u-tabbar :value="current?current:0" @change="tabChange" :fixed="true" :placeholder="true"
		:safeAreaInsetBottom="true" :border="false" activeColor="#ffd100">
		<u-tabbar-item :text="item.text" :icon="item.icon" v-for="(item,index) in tabList" :key="index"></u-tabbar-item>
	</u-tabbar>
</template>

<script>
	export default {
		props: {
			current: Number
		},
		data() {
			return {
				tabList: [{
					text: '商城',
					icon: 'home',
					pagePath: 'pages/index/index'
				}, {
					text: '我的订单',
					icon: 'order',
					pagePath: 'pages/order/index'
				}, {
					text: '个人中心',
					icon: 'account',
					pagePath: 'pages/personalCenter/index'
				}]
			}
		},
		onLoad(e) {

		},
		methods: {
			tabChange(e) {
				uni.switchTab({
					url: '/' + this.tabList[e].pagePath,
				})
			},
		}
	}
</script>

<style>
</style>